package event

import (
	"context"
	"ez/apps/flow/auto/mc"
	flow "ez/apps/flow/document"
	"ez/apps/flow/service"
	"gitee.com/dreamwood/ez-go/ez"
)

func init() {
	ez.Subscribe(mc.FlowingEventAfterSave, func(v interface{}, ctx context.Context) {
		ez.Debug(mc.FlowingEventAfterSave)
		md, ok := v.(*flow.Flowing)
		if ok {
			ez.Debug(mc.FlowingEventAfterSave)
			service.PublishOnChange(md)
		}
	})
}
